<template>
  <div class='container'>
    <el-dialog
      title="预览页面"
      :visible="previewdialog"
      width="52%"
      :before-close="Close">
      <h2>{{currArticle.title}}</h2>
      <div>
        <span>  {{currArticle.createTime|parseTimeByString}}  </span>
        <span>  {{currArticle.username}}  </span>
        <i class="el-icon-view"></i>
        <span>  {{currArticle.visits}}  </span>
      </div>
      <div class="articleBody">
        <div v-html="currArticle.articleBody"></div>
      </div>
    </el-dialog>

  </div>
</template>

<script>
export default {
  props: {
    previewdialog: {
      typeof: Boolean,
      default: false
    },
    currArticle: {
      typeof: Object,
      required: true
    }
  },
  methods: {
    Close () {
      this.$emit('update:previewdialog', false)
    }
  }
}
</script>

<style scoped lang='scss'>
.articleBody{
  margin-top: 10px;
  padding: 10px;
  background-color: #ccc;
  border-top: 1px dashed #333;
}
</style>
